import type { PageReqDto } from '@/api/types'
import request from '@/utils/request'
import type { BlackDto, BlackReqDto } from './types'

export function getInsuranceBlackList(params:  PageReqDto & {
    name?: string
    type?: number // 1 企业 2 被派遣单位 3 员工
}): Promise<BlackDto[]> {
    return request.get('/crm-prod/insur/Blacklist/list', {
        params
    })
}

export function exportInsuranceBlackList(params: {
    name?: string
    type?: number // 1 企业 2 被派遣单位 3 员工
}): Promise<string> {
    return request.get('/crm-prod/insur/Blacklist/export', {
        params
    })
}

export function addInsuranceBlack(data: BlackReqDto) {
    return request.post('/crm-prod/insur/Blacklist', data)
}

export function editInsuranceBlack(data: BlackReqDto) {
    return request.put('/crm-prod/insur/Blacklist', data)
}